<template>
  <div class="setting">
    <div class="set-title">
      <h2>设置</h2>
    </div>
    <div class="box">
      <div class="list">
        <span class="name">外观</span>
        <div class="colors">
          <div class="color-list" @click="changeTheme('sun')">
            <div class="color-info sun">浅色</div>
            <svg-icon v-if="theme == 'sun'" icon-class="icon-check"></svg-icon>
          </div>
          <div class="color-list" @click="changeTheme('dark')">
            <div class="color-info dark">深色</div>
            <svg-icon v-if="theme == 'dark'" icon-class="icon-check"></svg-icon>
          </div>
        </div>
      </div>
    </div>
    <div class="box">
      <div class="list2">
        <span class="name">登录设备管理</span>
        <div class="colors2">
          <div class="color-list2" @click="changDevice('pc')">
            <div class="color-info pc">PC</div>
          </div>
          <div class="color-list2" @click="changDevice('Android')">
            <div class="color2-info Android">Android</div>
          </div>
          <div class="color-list2" @click="changeTheme('IOS')">
            <div class="color-info IOS">IOS</div>
          </div>
          <div class="color-list2" @click="changeTheme('HarmonyOS')">
            <div class="color3-info HarmonyOS">鸿蒙</div>
          </div>
        </div>
      </div>
    </div>
     <div class="box">
      <div class="list3">
        <span class="name">文件下载位置</span>
        <div class="colors3">
          <div class="color-list3" @click="changeTheme('loca')">
            <div class="color5-info loca">文件位置：C:\pdf to epub</div>
          </div>
          <div class="color-list0" @click="changeTheme('change')">
            <div class="color0-info change">更改</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Setting",
  data() {
    return {
      theme: this.$store.state.theme,
    }
  },
  methods: {
    changeTheme(theme) {
      this.theme = theme;
      this.$parent.changeThemes(theme);
    }
  }
}
</script>

<style scoped>
.setting {
  margin: 0 2rem;
}
.set-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 5rem;
}
h2 {
  display: inline;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 600;
}
.box {
  display: flex;
  align-items: center;
  height: 6rem;
  margin-bottom: 2rem;
  padding: 0 2rem;
  border-radius: 16px;
  background-color: var(--BG);
}
.list {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 6rem;
}
.name {
  color: var(--Gray-8);
  line-height: 2rem;
  font-weight: 500;
}
.colors {
  display: flex;
  align-items: center;
  height: 6rem;
}
.color-list0 {
  overflow: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 4rem;
  height: 2.5rem;
  margin: 0 .8rem;
  color: #fff;
  border-radius: 0.7rem;
  box-shadow: 0 0 16px 0 rgba(0, 0, 0, .2) inset;
  transition: .1s ease-in-out;
}

.color-list0:nth-of-type(2) {
  background-color: var(--Theme-6);
  box-shadow: 0 0 16px 0 rgba(6, 78, 59, .4) inset;
  box-shadow: 0 0 0 0 #A7F3D0;
}
.color-list0:hover {
  width: 4.8rem;
  height: 3rem;
}
.color-list {
  overflow: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 4rem;
  height: 2.5rem;
  margin: 0 .8rem;
  color: #fff;
  border-radius: 0.7rem;
  box-shadow: 0 0 16px 0 rgba(0, 0, 0, .2) inset;
  transition: .1s ease-in-out;
}
.color-list:nth-of-type(1) {
  background-color: #dddddd;
  box-shadow: 0 0 16px 0 rgba(30, 58, 138, .4) inset;
  box-shadow: 0 0 0 0 #BFDBFE;
}
.color-list:nth-of-type(2) {
  background-color: #353535;
  box-shadow: 0 0 16px 0 rgba(6, 78, 59, .4) inset;
  box-shadow: 0 0 0 0 #A7F3D0;
}
.color-list:hover {
  width: 4.8rem;
  height: 3rem;
}

svg {
  z-index: 10;
}
.color0-info {
  position: absolute;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.7rem;
}
.color-info {
  position: absolute;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.7rem;
}
.sun {
  color:#4e4e4e;
}
.dark {
  color:#e9e9e9;
}
/* 设备管理的css */
.list2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 6rem;
}

.colors2 {
  display: flex;
  align-items: center;
  height: 6rem;
}
.color-list2 {
  overflow: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 4rem;
  height: 2.5rem;
  margin: 0 .8rem;
  color: #fff;
  border-radius: 0.7rem;
  box-shadow: 0 0 16px 0 rgba(0, 0, 0, .2) inset;
  transition: .1s ease-in-out;
}
.color-list2:nth-of-type(1) {
  background-color: var(--Theme-6);
  box-shadow: 0 0 16px 0 rgba(30, 58, 138, .4) inset;
  box-shadow: 0 0 0 0 #BFDBFE;
}
.color-list2:nth-of-type(2) {
  background-color: var(--Theme-6);
  box-shadow: 0 0 16px 0 rgba(6, 78, 59, .4) inset;
  box-shadow: 0 0 0 0 #A7F3D0;
}
.color-list2:nth-of-type(3) {
  background-image: linear-gradient(to bottom right, var(--Theme-6), var(--Theme-6));
  box-shadow: 0 0 16px 0 rgba(136, 19, 55, .4) inset;
  box-shadow: 0 0 0 0 #FECDD3;
}
.color-list2:nth-of-type(4) {
  background-image: linear-gradient(to bottom right, var(--Theme-6), var(--Theme-6));
  box-shadow: 0 0 16px 0 rgba(124, 45, 18, .4) inset;
  box-shadow: 0 0 0 0 #FED7AA;
}
.color-list2:hover {
  width: 4.8rem;
  height: 3rem;
}
.color2-info {
  position: absolute;
  /* left: 0; */
  text-align: center;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.7rem;
}
.color3-info {
  position: absolute;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.7rem;
}
/* 文件位置的css */
.list3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 6rem;
}

.colors3 {
  display: flex;
  align-items: center;
  height: 6rem;
}
.color-list3 {
  overflow: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 14rem;
  height: 2.5rem;
  margin: 0 .8rem;
  color: #fff;
  border-radius: 0.7rem;
  box-shadow: 0 0 16px 0 rgba(0, 0, 0, .2) inset;
  transition: .1s ease-in-out;
}
.color-list4 {
  overflow: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 14rem;
  height: 2.9rem;
  margin: 0 .8rem;
  color: #fff;
  border-radius: 0.7rem;
  box-shadow: 0 0 16px 0 rgba(0, 0, 0, .2) inset;
  transition: .1s ease-in-out;
}
.color-list3:nth-of-type(1) {
  background-color: #dddddd;
  box-shadow: 0 0 16px 0 rgba(30, 58, 138, .4) inset;
  box-shadow: 0 0 0 0 #BFDBFE;
}
.color-list3:nth-of-type(2) {
  background-color: var(--Theme-6);
  box-shadow: 0 0 16px 0 rgba(56, 177, 145, 0.4) inset;
  box-shadow: 0 0 0 0 #111614;
}
.color-list3:hover {
  width: 15rem;
  height: 3.2rem;
}
.color4-info {
  position: absolute;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.7rem;
}
.color5-info {
  position: absolute;
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.7rem;
}
.loca{
  color:#4e4e4e;
}
.change{
  color: rgb(255, 255, 255);
}
</style>